<?
$finance[0]=$order_list_0_days=select_lines_all_items($table_prefix."order_list","","date like'".date("Y-m-d")."%' ","");
$finance[1]=$order_list_1_days=select_lines_all_items($table_prefix."order_list","","date like'".date("Y-m-d",strtotime("-1 day"))."%' ","");
$finance[2]=$order_list_2_days=select_lines_all_items($table_prefix."order_list","","date like'".date("Y-m-d",strtotime("-2 day"))."%' ","");
$finance[3]=$order_list_3_days=select_lines_all_items($table_prefix."order_list","","date like'".date("Y-m-d",strtotime("-3 day"))."%' ","");
$finance[4]=$order_list_4_days=select_lines_all_items($table_prefix."order_list","","date like'".date("Y-m-d",strtotime("-4 day"))."%' ","");
$finance[5]=$order_list_5_days=select_lines_all_items($table_prefix."order_list","","date like'".date("Y-m-d",strtotime("-5 day"))."%' ","");
$finance[6]=$order_list_6_days=select_lines_all_items($table_prefix."order_list","","date like'".date("Y-m-d",strtotime("-6 day"))."%' ","");
?>




<fieldset class="layui-elem-field layui-field-title" >
    <legend>订单信息</legend>
</fieldset>
<!-- TODO 备注一下
//这里显示的是近7天订单的完成状况。目前是最后处理完所有订单的话，都会是中间的待完成待发货，都是0-->
<!--//是否应该显示当天订单的固定值。例如有多少张单是当天完成的。-->


<div class="layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col>
            <col>
            <col>
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>日期</th>
            <th>新增订单</th>
            <th>待确认</th>
            <th>待发货</th>
            <th>待收款</th>
            <th>已发货</th>
            <th>已完成</th>
<!--            <th>当日汇率</th>-->

        </tr>
        </thead>
        <tbody>

        <? for($i=0;$i<7;$i++){?>
            <tr>
                <td><?echo date("Y-m-d",strtotime("-$i day"))?></td>

                <?
                $p['array']=$finance[$i];
                $p['condition_key']="date";
                $p['condition_range']="like";
                $p['condition_value']=date("Y-m-d",strtotime("-$i day"));
                $p['target']='price';
                $result=sum_with_key_by_value_in_2d_array($p);
                ?>
                <td><?echo $result['num']?> 单 /  <?echo $result['sum']?>元</td>

                <?
                $p['condition_key']="status";
                $p['condition_range']="==";
                $p['condition_value']="待确认";
                $result=sum_with_key_by_value_in_2d_array($p);
                ?>
                <td><?echo $result['num']?> 单 /  <?echo $result['sum']?>元</td>

                <?
                $p['condition_value']="待收款";
                $result=sum_with_key_by_value_in_2d_array($p);
                ?>
                <td><?echo $result['num']?> 单 /  <?echo $result['sum']?>元</td>

                <?
                $p['condition_value']="待发货";
                $result=sum_with_key_by_value_in_2d_array($p);
                ?>
                <td><?echo $result['num']?> 单 /  <?echo $result['sum']?>元</td>

                <?
                $p['condition_value']="已发货";
                $result=sum_with_key_by_value_in_2d_array($p);
                ?>
                <td><?echo $result['num']?> 单 /  <?echo $result['sum']?>元</td>

                <?
                $p['condition_value']="已完成";
                $result=sum_with_key_by_value_in_2d_array($p);
                ?>
                <td><?echo $result['num']?> 单 /  <?echo $result['sum']?>元</td>
<!--                <td>9.34</td>-->
            </tr>
        <?}?>




        </tbody>
    </table>
</div>